#ifndef CTIMER_H
#define CTIMER_H

#include <SDL/SDL.h>
#include "../defines/defines.h"
#include <iostream>
#ifdef DEBUG
#include "../logger/CLogger.h"
#endif
class CTimer {

public:
	CTimer(void);
	virtual ~CTimer(void);

	void Start();
	void Pause();
	void Resume();
	void Stop();

	void DrawFPS();
	void KeepFPS(const Uint32 fps);

	inline bool isRunning() {return running;};
	inline bool isPaused() {return paused;};

	Uint32 TimeSinceCreation();
	Uint32 TimeSinceEvent();


private:
	//vars for drawfps function:
	Uint32 g_dwLastFPS;
	int g_nFPS, g_nFrames;
	//Timer vars:
	Uint32 m_timeOfLastCall;

	Uint32 m_startTime;
	Uint32 m_stopTime;


	bool paused;
	bool running;

};

#endif /* CTIMER_H */

